files = dir(fullfile('C:', 'testfiles', '*.dat'));
for j=1:size(files)
    i=load(files(j).name);
    H = spconvert(i);
    [V,D] = eigs(H, 250);
    dlmwrite(strrep(fullfile('C:', 'testfiles',files(j).name), '.dat', '.vect'), V);
    dlmwrite(strrep(fullfile('C:', 'testfiles',files(j).name), '.dat', '.eval'), D);
end